finding sides of right triangle